
$(function(){
	//点眼睛显示密码
	var $eye = $(".eye-password-display");
	var $targets = $("#input-password,#register-password,#re-register-password,#reset-password,#reset-repassword");
	eyetoggle($eye,$targets);
    //register前端验证
    //用户名验证
    var username,email,password,repassword;
	$("#register-username").on("blur",function(){
		username = $(this).val();
		var targetusername = $(".alert-username");
		if(!username_vel(username,targetusername)){
			return false;
		};	
	});
	//邮箱验证
	$("#register-email").on("blur",function(){
		email = $(this).val();
		var targetemail = $(".alert-email");
		if(!email_vel(email,targetemail)){
			return false;
		}
	});
	//密码验证
	$("#register-password").on("blur",function(){
		password = $(this).val();
		repassword=$("#re-register-password").val();
		var targetpassword = $(".alert-password");
		var targetrepassword = $(".alert-repassword");
		if(!password_vel(password,repassword,targetpassword,targetrepassword)){
			return false;
		}	
	});
	$("#re-register-password").on("blur",function(){
		password = $("#register-password").val();
		repassword=$(this).val();
		if (password == repassword){
			$(".alert-repassword").html("");
		}else{
			info = alert+'两次输入密码不一致</div>'; 
			$(".alert-repassword").html(info);
		}
	});
	$("#register-reset").on("click",function(){
		$(".alert-username,.alert-email,.alert-password,.alert-repassword,.alert-reemail").html("");
	});
});
